<template>
    <view class="container">
        <uni-forms :modelValue="postItem" ref="propItem" :rules="rules" label-width="80px">
            <uni-forms-item label="图纸类型" required name="cat">
                <view style="display: flex;align-items: center;">
                    <uni-data-checkbox v-model="postItem.cat" :localdata="catlist"></uni-data-checkbox>
                </view>
             
            </uni-forms-item>
            <uni-forms-item label="图纸名称" required name="title">
                <uni-easyinput style="width: 450rpx;" v-model="postItem.title" placeholder="图纸名称" />
            </uni-forms-item>
            <uni-forms-item label="图纸上传" required name="file">
                <uni-file-picker limit="5" file-mediatype="all" title="一次最多选择5个文件"></uni-file-picker>
            </uni-forms-item>
            <uni-forms-item label="图纸编号" required name="code">
                <uni-easyinput style="width: 450rpx;" v-model="postItem.code" placeholder="不填自动按上传顺序生成" />
            </uni-forms-item>
            <view class="btns" style="display: flex;justify-content: end;">
                <button type="primary" size="mini" @click="submit('buyForm')">提交保存</button>
            </view>
        </uni-forms>
    </view>
</template>

<script >
    export default{
        name:"Design",
        props:{
            oid:Number
        },
        data(){
            return{
                catlist:[
                    {text:'总图纸',value:"1"},
                    {text:'激光图',value:"2"},
                    {text:'雕刻图',value:"3"}
                ],
                postItem:{
                    cat:1,
                    title:'',
                    file:'',
                    code:''
                },
                rules:{
                    cat: {
                        rules: [{
                            required: true,
                            errorMessage: '请选择图纸类型'
                        }]
                    },
                }
            }
        },
        watch:{},
        onShow(){},
        methods:{
            radioChange(e){
                
            },
            submit(ref){
                
            }
        }
    }
</script>

<style lang="less" scoped>
</style>